home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk66 / qrt15 / docs / cfg.doc < prev    next >
Text File  |  1995-03-19  |  7KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.            Context Free Grammar for QRT Input Language
  11.  
  12.  
  13.  
  14.    Notes: '(' and ')' are non-terminal symbols
  15.           (  and  )   are CFG parens
  16.           +           is one or more than one
  17.  
  18.           * lower case strings in grammar are non-terminals
  19.           * input language is not case sensitive
  20.           * <WHITE_SPACE> = blank | newline | tab
  21.           * args can be separated by optional ',' or ';'
  22.           * '=' can separate argument name from value
  23.                 or string.
  24.  
  25.  
  26.  
  27.   <WORLD>         = <INSTANCE_DEFS> ( <OBJECT> | <ATTRIBUTE> )+
  28.  
  29.    
  30.   <INSTANCE_DEFS> = begin_instances <OBJECT>+ end_instances
  31.  
  32.  
  33.   <OBJECT>        = <PRIMITIVE>+ |
  34.                     ( name <STRING> | <EMPTY> )
  35.                        begin_bbox <OBJECT> end_bbox
  36.  
  37.  
  38.   <PRIMITIVE>     = <SPHERE> |
  39.                     <PARALLELOGRAM> |
  40.                     <RING> |
  41.                     <QUADRATIC> |
  42.                     <INSTANCE_OF>
  43.  
  44.  
  45.   <ATTRIBUTE>     = <SKY>               |
  46.                     foc_length <NUMBER> |
  47.                     <DEFAULT>           |
  48.                     file_name  <STRING> |
  49.                     <LAMP>              |
  50.                     <PATTERN>           |
  51.                     <OBSERVER>
  52.  
  53.  
  54.   <SPHERE>        = sphere '(' <SPHERE_DEF>+ ')'
  55.  
  56.  
  57.  
  58.  
  59.  
  60. QRT Ray Tracer               Page 1          Context Free Grammar
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   <SPHERE_DEF>    = <POSITION>    |
  74.                     name <STRING> |
  75.                     radius  <NUM> |
  76.                     <CINFO>       |
  77.                     pattern <STRING> |
  78.                     remove  <STRING>
  79.  
  80.  
  81.   <PARALLELOGRAM> = parallelogram '(' <PAR_DEF>+ ')'
  82.  
  83.  
  84.   <PAR_DEF>       = <POSITION>     |
  85.                     name  <STRING> |
  86.                     v1    <VECTOR> |
  87.                     vect1 <VECTOR> |
  88.                     v2    <VECTOR> |
  89.                     vect2 <VECTOR> |
  90.                     <CINFO>        |
  91.                     pattern <STRING> |
  92.                     remove  <STRING>
  93.  
  94.  
  95.   <TRIANGLE>      = triangle '(' <TRIANGLE_DEF>+ ')'
  96.  
  97.  
  98.   <TRIANGLE_DEF>  = <POSITION>     |
  99.                     name  <STRING> |
  100.                     v1    <VECTOR> |
  101.                     vect1 <VECTOR> |
  102.                     v2    <VECTOR> |
  103.                     vect2 <VECTOR> |
  104.                     <CINFO>        |
  105.                     pattern <STRING> |
  106.                     remove  <STRING>
  107.  
  108.  
  109.   <RING>          = ring '(' <RING_REF>+ ')'
  110.  
  111.  
  112.   <RING_DEF>      = <POSITION>     |
  113.                     name  <STRING> |
  114.                     v1    <VECTOR> |
  115.                     vect1 <VECTOR> |
  116.                     v2    <VECTOR> |
  117.                     vect2 <VECTOR> |
  118.                     rad_1   <NUM>  |
  119.                     rad_2   <NUM>  |
  120.                     <CINFO>        |
  121.                     pattern <STRING> |
  122.                     remove  <STRING>
  123.  
  124.  
  125.  
  126. QRT Ray Tracer               Page 2          Context Free Grammar
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   <QUADRATIC>     = quadratic '(' <QUAD_DEF>+ ')'
  141.  
  142.  
  143.   <QUAD_DEF>      = <POSITION>    |
  144.                     name <STRING> |
  145.                     a       <NUM> |
  146.                     b       <NUM> |
  147.                     c       <NUM> |
  148.                     d       <NUM> |
  149.                     xmin    <NUM> |
  150.                     xmax    <NUM> |
  151.                     ymin    <NUM> |
  152.                     ymax    <NUM> |
  153.                     zmin    <NUM> |
  154.                     zmax    <NUM> |
  155.                     dir  <VECTOR> |
  156.                     <CINFO>       |
  157.                     pattern <STRING> |
  158.                     remove  <STRING>
  159.  
  160.  
  161.   <INSTANCE_OF>   = instance_of '(' <INSTANCE>+ ')'
  162.  
  163.  
  164.   <INSTANCE>      = name <STRING>       |
  165.                     <POSITION>          |
  166.                     scale    = <VECTOR>
  167.  
  168.  
  169.   <SKY>           = sky '(' <SKY_DEF>+ ')'
  170.  
  171.  
  172.   <SKY_DEF>       = zenith <COLOR_TRIPLE> |
  173.                     horiz  <COLOR_TRIPLE>
  174.  
  175.  
  176.   <DEFAULT>       = default '(' <DEFAULT_DEF>+ ')'
  177.  
  178.  
  179.   <DEFAULT_DEF>   = <CINFO>       |
  180.                     no_shadow     |
  181.                     no_lamp       |
  182.                     x_res <NUM>   |
  183.                     y_res <NUM>   |
  184.                     aspect <NUM>  |
  185.                     threshold <NUM>
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. QRT Ray Tracer               Page 3          Context Free Grammar
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.   <LAMP>          = lamp '(' <LAMP_DEF>+ ')'
  206.  
  207.  
  208.   <LAMP_DEF>      = <POSITION>    |
  209.                     radius  <NUM> |
  210.                     dist    <NUM> |
  211.                     <AMB>+
  212.  
  213.  
  214.   <OBSERVER>      = observer '(' <OBS_DEF>+ ')'
  215.  
  216.  
  217.   <OBS_DEF>       = <POSITION>      |
  218.                     lookat <VECTOR> |
  219.                     up     <VECTOR>
  220.  
  221.  
  222.   <PATTERN>       = pattern '(' <PATTERN_DEF>+ ')'
  223.  
  224.  
  225.   <PATTERN_DEF>   = x_size   <NUM>    |
  226.                     y_size   <NUM>    |
  227.                     name     <STRING> |
  228.                     '(' <SUB_PATTERN>+ ')'
  229.  
  230.  
  231.   <SUB_PATTERN>   = RECTANGLE <RECTANGLE_PAT> |
  232.                     CIRCLE    <CIRCLE_PAT>    |
  233.                     POLYGON   <POLY_PATT>
  234.  
  235.  
  236.   <RECTANGLE_PAT> = start_x   <NUM> |
  237.                     stary_y   <NUM> |
  238.                     start_z   <NUM> |
  239.                     end_x     <NUM> |
  240.                     end_y     <NUM> |
  241.                     end_z     <NUM> |
  242.                     <CINFO>
  243.  
  244.  
  245.   <CIRCLE_PAT>    = radius    <NUM>
  246.                     <CINFO>
  247.  
  248.  
  249.   <POLY_PATT>     = <CINFO>           |
  250.                     ( POINT    '(' <NUM>, <NUM> ')'  )+
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. QRT Ray Tracer               Page 4          Context Free Grammar
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.   <POSITION>      = LOC      <VECTOR> |
  272.                     POS      <VECTOR> |
  273.                     LOCATION <VECTOR> |
  274.                     POSITION <VECTOR>
  275.  
  276.  
  277.   <CINFO>         = <AMB>          |
  278.                     <DIFF>         |
  279.                     <TRANS>        |
  280.                     <DENSITY>      |
  281.                     <MIRROR>       |
  282.                     fuzz     <INT> |
  283.                     index    <NUM> |
  284.                     dither   <INT> |
  285.                     sreflect <NUM> |
  286.                     reflect  <NUM>
  287.  
  288.  
  289.   <AMB>           = amb     <COLOR_TRIPLE>
  290.  
  291.  
  292.   <DIFF>          = diff    <COLOR_TRIPLE>
  293.  
  294.  
  295.   <TRANS>         = trans   <COLOR_TRIPLE>
  296.  
  297.  
  298.   <MIRROR>        = mirror  <COLOR_TRIPLE>
  299.  
  300.  
  301.   <DENSITY>       = density <COLOR_TRIPLE>
  302.  
  303.  
  304.   <COLOR_TRIPLE>  = '(' <NUM>, <NUM>, <NUM> ')'
  305.  
  306.  
  307.   <VECTOR>        = '(' <NUM>, <NUM>, <NUM> ')'
  308.  
  309.  
  310.   <NUM>           =   <INT> |
  311.                     - <INT> |
  312.                       <INT> . <INT> |
  313.                     - <INT> . <INT>
  314.  
  315.  
  316.   <INT>           = <DIGIT>+
  317.  
  318.  
  319.   <DIGIT>         = 0|1|2|3|4|5|6|7|8|9
  320.  
  321.  
  322.  
  323.  
  324. QRT Ray Tracer               Page 5          Context Free Grammar
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.   <STRING>        = ( <ALPHA> | <DIGIT> )+
  338.  
  339.  
  340.   <ALPHA>         = a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|
  341.                     q|r|s|t|u|v|w|x|y|z|_|*|-
  342.  
  343.  
  344.   <EMPTY>         =
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390. QRT Ray Tracer               Page 6          Context Free Grammar
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.